---
description: "Reference for Nitric's v0 Node.js library - Get a list of file references for files that exist in the bucket."
---

# Node.js - bucket.files()

Get a list of file references for files that exist in the bucket.

```javascript
import { bucket } from '@nitric/sdk'

const assets = bucket('assets').for('reading')

const files = await assets.files()
```

## Examples

Deleting all files in a bucket

```javascript
import { bucket } from '@nitric/sdk'

const assets = bucket('assets').for('reading')

const files = await assets.files()

await Promise.all(files.forEach(async (file) => await file.delete()))
```

## Notes

This method returns a list of [File](./bucket-file) references that exist on the bucket.
